package com.itheima.mapper;

import com.itheima.pojo.SysConfig;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author TrainingL
 * @since 2023-05-13
 */
@Mapper
public interface SysConfigMapper extends BaseMapper<SysConfig> {

    /**
     * 通过tab和group嵌套查询配置
     * @param tabValue
     * @param groupValue
     * @return
     */
@Select("select * from (select * from sys_config where tab_value= #{tabValue}) a where group_value = #{groupValue}")
    List<SysConfig> listByTabAndGroup(String tabValue, String groupValue);
}
